'use strict';
const requireEx=require('yi-require');
const $ = requireEx('yi-schema');

module.exports = {
  body: $.object({
    fromID:$.mongoid().required().description("消息发送者ID"),
    fromNickname:$.string().description("消息发送者昵称"),
    fromHeadPicPath:$.string().description("消息发送者头像路径"),
    toID:$.mongoid().required().description("消息接收者ID"),
    toNickname:$.string().description("消息接收者昵称"),
    toHeadPicPath:$.string().description("消息接收者头像路径"),
    content:$.string().min(1).max(300).description("消息内容"),
    readState:$.number().valid(0,1).default(0).description("阅读状态，1：已读，0：未读，默认0"),
    messageType:$.number().valid(0,1).default(0).description("消息类型，1：阅后即焚，0：普通，默认0")
  })
};